﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace RestaurantWPF
{
    /// <summary>
    /// Interaction logic for WaiterMain.xaml
    /// </summary>
    public partial class WaiterMain : Window
    {
        private void PrintAllTables(int numOfTables)
        {
            for (int i = 1; i <= numOfTables; i++)
            {
                var textBlock = new TextBlock();
                    textBlock.Text = i.ToString();
                    textBlock.TextAlignment = TextAlignment.Center;
                    textBlock.MouseLeftButtonUp += (snd, args) =>
                        {
                            var newWindow = new NewOrder();
                            newWindow.Show();
                        };
                    this.FreeTablesStack.Children.Add(textBlock);
            }
        }

        public WaiterMain()
        {
            InitializeComponent();
            PrintAllTables(15);
        }

        private void OnServedTableStateClick(object sender, MouseButtonEventArgs e)
        {
            var newWindow = new ServedTableState();
            newWindow.Show();
        }
    }
}
